package com.wmyg.tracker.bean;

import com.alibaba.fastjson.annotation.JSONField;
import lombok.Data;

import java.io.Serializable;

@Data
public class UnitInfo implements Serializable {

    private static final long serialVersionUID = -5809782578272943999L;

    public UnitInfo(){

    }

    @JSONField(name = "qrcodeId")
    private String qrcodeId;//二维码id

    @JSONField(name = "qr")
    private String qR;//二维码信息

    @JSONField(name = "product_time")
    private String productTime;//商品生产时间

    @JSONField(name = "item_no")
    private String itemNo;//商品编号，productId

    @JSONField(name = "enter_batch")
    private String enterBatch;//生产批次

    @JSONField(name = "producer")
    private String producer;//录入人ID

    @JSONField(name = "environment")
    private String environment;//生产环境

    @JSONField(name = "material_batch")
    private String materialBatch;//原料批次

    @JSONField(name = "enter_time")
    private String enterTime;//录入时间，系统生成

    @JSONField(name = "num_of_son_packs")
    private Integer numOfSonPacks;

    @JSONField(name = "pack_level")
    private String packLevel;

    public void setqR(String qR) {
        this.qR = qR;
    }

    public String getqR() {
        return qR;
    }

    public String getQR() {
        return qR;
    }

    public void setQR(String qR) {
        this.qR = qR;
    }

    public String getProductTime() {
        return productTime;
    }

    public void setProductTime(String productTime) {
        this.productTime = productTime;
    }

    public String getItemNo() {
        return itemNo;
    }

    public void setItemNo(String itemNo) {
        this.itemNo = itemNo;
    }

    public String getEnterBatch() {
        return enterBatch;
    }

    public void setEnterBatch(String enterBatch) {
        this.enterBatch = enterBatch;
    }

    public String getProducer() {
        return producer;
    }

    public void setProducer(String producer) {
        this.producer = producer;
    }

    public String getEnvironment() {
        return environment;
    }

    public void setEnvironment(String environment) {
        this.environment = environment;
    }

    public String getMaterialBatch() {
        return materialBatch;
    }

    public void setMaterialBatch(String materialBatch) {
        this.materialBatch = materialBatch;
    }

    public String getEnterTime() {
        return enterTime;
    }

    public void setEnterTime(String enterTime) {
        this.enterTime = enterTime;
    }

    public String getQrcodeId() {
        return qrcodeId;
    }

    public void setQrcodeId(String qrcodeId) {
        this.qrcodeId = qrcodeId;
    }

    @Override
    public boolean equals(Object obj) {
        if (obj == null) {
            return false;
        }
        if (obj instanceof UnitInfo) {
            UnitInfo u = (UnitInfo) obj;
            if (u.getQR().equals(this.getQR())) {
                return true;
            }
        }
        return false;
    }

    public UnitInfo(String productTime, String itemNo, String enterBatch, String producer, String environment, String materialBatch) {
        this.productTime = productTime;
        this.itemNo = itemNo;
        this.enterBatch = enterBatch;
        this.producer = producer;
        this.environment = environment;
        this.materialBatch = materialBatch;
    }
}
